﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace UtilsORM.MySqlData;

[Index("l_guid", Name = "idxdclguid")]
[Index("l_d_guid", Name = "idxdguid")]
[MySqlCharSet("utf8mb3")]
[MySqlCollation("utf8mb3_general_ci")]
public partial class iot_device_command_log
{
    [Key]
    public long l_id { get; set; }

    public string l_guid { get; set; }

    public string l_d_guid { get; set; }

    /// <summary>
    /// 执行内容
    /// </summary>
    public string l_content { get; set; }

    /// <summary>
    /// 执行key
    /// </summary>
    [StringLength(50)]
    public string l_key { get; set; }

    /// <summary>
    /// 指令名称
    /// </summary>
    [StringLength(255)]
    public string l_name { get; set; }

    [StringLength(100)]
    public string l_status_remark { get; set; }

    /// <summary>
    /// 发送指令的人
    /// </summary>
    [StringLength(255)]
    public string l_user_name { get; set; }

    /// <summary>
    /// 发送指令人的IP
    /// </summary>
    [StringLength(255)]
    public string l_user_remote_ip { get; set; }

    /// <summary>
    /// 0待执行,1处理中，2回调成功，3异常,4已发送mq,5mq发送失败
    /// </summary>
    public int? l_status { get; set; }

    [StringLength(255)]
    public string l_user_guid { get; set; }

    [StringLength(50)]
    public string l_mqevent { get; set; }

    /// <summary>
    /// 协议
    /// </summary>
    [StringLength(50)]
    public string l_agreement_type { get; set; }

    [StringLength(100)]
    public string l_device_remark { get; set; }

    /// <summary>
    /// 设备id
    /// </summary>
    [StringLength(255)]
    public string l_gateway_code { get; set; }

    /// <summary>
    /// 响应回传信息
    /// </summary>
    [Column(TypeName = "text")]
    public string l_return_msg { get; set; }

    /// <summary>
    /// 向应回传时间
    /// </summary>
    [Column(TypeName = "datetime")]
    public DateTime? l_return_time { get; set; }

    [Column(TypeName = "datetime")]
    public DateTime l_add_time { get; set; }

    /// <summary>
    /// 设备型号
    /// </summary>
    [StringLength(255)]
    public string l_device_model_code { get; set; }

    [StringLength(50)]
    public string l_gateway_deviceguid { get; set; }

    /// <summary>
    /// 设备参数
    /// </summary>
    [StringLength(1000)]
    public string l_parameter { get; set; }

    /// <summary>
    /// 重复执行次数，0无限
    /// </summary>
    public int? l_repeat_count { get; set; }

    /// <summary>
    /// 毫秒，最大支持864000000，约10天
    /// </summary>
    public int? l_repeat_count_interval { get; set; }

    /// <summary>
    /// 消息来源
    /// </summary>
    [StringLength(255)]
    public string l_source { get; set; }
}
